package com.itheima.concurrent;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class MyFutureTask {

    public static void main(String[] args) throws Exception {
        Callable<Integer> callable = new Callable<Integer>() {
            public Integer call() throws Exception {
                return 2+9;
            }
        };
        FutureTask futureTask = new FutureTask(callable);

        Lock lock = new ReentrantLock(false);
        boolean tryLock = lock.lock();
        Object o = futureTask.get();
        System.out.println(">>>>>>>>>> " + o);

    }
}
